package com.stu.common.utils;

import com.stu.entity.Student;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class GenerateUtils<T> {

    public void test(Class<T> model) throws NoSuchMethodException {
        Field[] fields = model.getDeclaredFields();
        System.out.println("开始");
       // System.out.println(fields[0]);
        for (Field field : fields) {
            System.out.println(field);
        }

        Method[] method1 = model.getMethods();
        for (Method method : method1) {
            System.out.println(method);
            System.out.println(method.getName());
//            System.out.println(method);
        }
    }


    public static void main(String[] args) throws NoSuchMethodException {
        GenerateUtils<Student> generateUtils = new GenerateUtils<Student>();
        Student student = new Student();
        generateUtils.test(Student.class);

      /*  Field[] fields = Student.class.getDeclaredFields();
        System.out.println("开始");
        // System.out.println(fields[0]);
        for (Field field : fields) {
            System.out.println(field);
        }*/
    }
}
